﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FoodList.aspx.cs" Inherits="shop_FoodList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Src="~/Banner.ascx" TagPrefix="top" TagName="banner" %>
<%@ Register Src="~/header.ascx" TagName="banner" TagPrefix="uc1" %>
<%@ Register Src="~/Foot.ascx" TagPrefix="foot" TagName="foot" %>
<%@ Register Src="~/shop/Left.ascx" TagName="LeftBanner" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>餐品列表-<%= WebUtility.GetWebName()%></title>

    <link href="/user/css/userinfo.css" rel="stylesheet" type="text/css" />
    <link href="/css/common.css" rel="stylesheet" type="text/css" />
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/user/css/common.css" rel="stylesheet" type="text/css" />

    <script src="../JavaScript/jquery-1.3.2.js" type="text/javascript"></script>

    <script src="../JavaScript/ShowDivDialog.js" type="text/javascript"></script>
     <script type="text/javascript">
         $(document).ready(function () {
             initshopnav(4);

         })
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <top:banner ID="Banner1" runat="server" />
        <uc1:banner ID="Banner2" runat="server" />
        <div class="shop_containner clearfix">
            <uc2:LeftBanner runat="server" ID="Left" />
            <div class="shop_main">
                <div class="main-content">
                    <div class="shop_menu">
                             <ul><li  ><a href="FoodSortList.aspx?">餐品类别列表</a></li>
                                 <li ><a href="FoodSortDetail.aspx">添加餐品类别</a></li>
                                 <li class="cur" ><a href="FoodList.aspx">餐品列表</a></li>
                                 <li ><a href="FoodDetail.aspx">添加餐品</a></li>

                             </ul>
                                </div>
                    <%--<h1 class="topbg">餐品列表</h1>--%>
                    <div class="listorder" style="margin-bottom:15px;">
                        <ul>
                            <li><span>名称</span>
                                <input id="tbKeyword" runat="server" name="workAddr" autocomplete="off" type="text" class="text" />


                                 <asp:DropDownList ID="ddlFoodType" runat="server" Width="100px" AppendDataBoundItems="true">
                                                            <asp:ListItem Text="分类" Value="-1"></asp:ListItem>
                                                        </asp:DropDownList>


                                                        <asp:DropDownList runat="server" ID="rblIsSpecial" >
                                                            <asp:ListItem Text="促销" Value="-1"></asp:ListItem>
                                                            <asp:ListItem Value="0">否</asp:ListItem>
                                                            <asp:ListItem Value="1">是</asp:ListItem>
                                                        </asp:DropDownList>


                            </li>
                            <li>
                                <asp:Button ID="btSearch" runat="server" Text="查询" CssClass="subBtn" OnClick="btSearch_Click" />
                            </li>
                        </ul>
                    </div>
                    <div class="listorder" style="display: none">
                        <ul>
                            <li><span>批量上传菜品</span>
                                <asp:FileUpload runat="server" ID="fuFoodExcel" />
                            </li>
                            <li>
                                <asp:Button ID="Button1" runat="server" Text="上传" CssClass="subBtn" OnClick="btAddExcel_Click" />
                                <asp:Button ID="Button2" runat="server" Text="上传帮助" CssClass="subBtn" OnClientClick="tipsWindown('上传帮助','id:divhelp','250','150','true','','true','text');return false;" />
                                <asp:Button ID="Button3" runat="server" Text="下载Execl" CssClass="subBtn" OnClientClick="window.open('download.aspx');return false;" />
                            </li>
                        </ul>
                    </div>

                     <fieldset class="AdminSearchform">
                                            <legend>批量设置库存</legend>
                                            <div style="clear: both; padding: 10px;">
                                                库存：<asp:TextBox runat="server" ID="tbaddsalary" Text="" CssClass="j_text" Width="40"></asp:TextBox>
                                          
                                                
                                                <asp:Button runat="server" ID="btalladd" class="subBtn" Text="当前搜索设置" OnClick="setsalary_Click" />

                                            </div>


                                        </fieldset>

                    <div class="clear"></div>
                    <div class="usermima">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="listorder_table"
                            style="border: 1px solid #ccc;">
                            <asp:Repeater ID="rptFoodList" runat="server" OnItemCommand="rptFoodList_ItemCommand">
                                <HeaderTemplate>
                                    <tr>
                                        <th>餐品名称
                                        </th>
                                        <th style="width: 10%">类别
                                        </th>
                                        <th style="width: 8%">价格
                                        </th>

                                         <th style="width: 12%">库存
                                        </th>
                                         <th style="width: 8%">促销
                                        </th>



                                        <th style="width: 8%">状态
                                        </th>
                                        <th style="width: 18%">操作
                                        </th>
                                    </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <%#Eval("FoodName")%>
                                        </td>
                                        <td>
                                            <%#Eval("SortName")%>
                                        </td>
                                        <td>
                                            <%#Eval("FPrice")%>
                                        </td>


                                        <td>
                                          
                                              <asp:TextBox runat="server" ID="tbRemains" class="massaction-checkbox" CssClass="j_text"
                                                                        MaxLength="5" Width="40" onkeypress="return only_num(event)" Text='<%# Eval("Remains") %>'></asp:TextBox>


                                                                         <asp:Button ID="lbdel" runat="server" CommandArgument='<%# Eval("unid") %>' Text="确定"  class="form-button" 
                                                                        CommandName="setstock"></asp:Button>



                                        </td>

                                        <td>
                                          <%# Eval("IsSpecial").ToString() =="0"? "否":"是"%>
                                        </td>





                                        <td>
                                            <%#Eval("InUse").ToString().Trim() == "n" ? "下线" : "上线"%>
                                        </td>
                                        <td>
                                            <asp:LinkButton ID="lbtdelete" runat="server" CommandName="del" OnClientClick="return confirm('确定在删除吗?');"
                                                CommandArgument='<%#Eval("Unid")%>'>删除</asp:LinkButton> | <asp:LinkButton
                                                    ID="lbtupdate" runat="server" CommandName="update" CommandArgument='<%#Eval("Unid")%>'>修改</asp:LinkButton> | <asp:LinkButton
                                                        ID="LinkButton1" runat="server" CommandName="set" CommandArgument='<%#Eval("Unid")%>'><%#Eval("InUse").ToString().Trim() == "n" ? "上线" : "下线"%></asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <tr>
                                    </tr>
                                </FooterTemplate>
                            </asp:Repeater>
                        </table>
                    </div>
                    <div id="noRecord" runat="server" class="no_infor">
                        暂无餐品！
                    </div>
                    <div class="pages">
                        <webdiyer:AspNetPager CssClass="anpager" ID="AspNetPager1" runat="server" Width="100%"
                            CustomInfoHTML="共有记录 <font>%RecordCount%</font> 条 当前为 <font>%CurrentPageIndex%</font>/<font>%PageCount%</font> 页"
                            HorizontalAlign="Right" ShowCustomInfoSection="Left" CustomInfoTextAlign="Right"
                            CustomInfoSectionWidth="28%" ShowPageIndexBox="Always" PageIndexBoxType="TextBox"
                            TextBeforePageIndexBox="转到 " OnPageChanged="AspNetPager1_PageChanged" PageIndexBoxClass="flattext"
                            ShowPageIndex="True" PageSize="20" SubmitButtonClass="flatbutton" SubmitButtonText=" GO "
                            TextAfterPageIndexBox=" 页 " Wrap="False">
                        </webdiyer:AspNetPager>
                    </div>
                </div>
            </div>
            <div id="divhelp" style="display: none">
                <div style="text-align: left; padding: 10px; line-height: 24px;">
                    <p>
                        1,点击下载Excel,根据excel模板输入菜品信息
                    </p>
                    <p>
                        2,输入完成后，直接上传就可以了。请按照excel模板输入信息
                    </p>
                </div>
            </div>
        </div>
        <foot:foot runat="server" ID="foot" />
    </form>
</body>
</html>
